<#assign module="company"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/jquery.Jcrop.css">
</@override>
<@override name="body">

	<div class="row">
		<div class="col-md-7">
			<div class="panel panel-default" style="height: 1000px;">
				<div class="panel-heading">
					公司位置定位
			    </div>
			    <div id="allmap" style="z-index: 99999; height:950px;">
        		</div>
			</div>
		</div>
		<div class="col-md-5">
			<div class="panel panel-default">
				<div class="panel-heading">
					填写公司信息
			    </div>
			    <div class="panel-body">
    				<form id="submit_form" action="${ctx}/company/update" class="form-horizontal" method="post">
    					<input type="hidden" id="id" name="id" value="${company.id}">
    					<input type="hidden" id="provName" name="provName" value="${company.provName?if_exists}" />
		                <input type="hidden" id="cityName" name="cityName" value="${company.cityName?if_exists}" />
		                <input type="hidden" id="upload_img_logo_token" value="${upload_img_logo_token}" />
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>地区：</label>
		                    <div class="col-sm-3">
		                    	<select class="form-control" id="prov" required></select>
		                    </div>
		                    <div class="col-sm-4">
		                    	<select class="form-control" id="city" required></select>
		                    </div>
		                </div>
		                
		                <@daijia>
    					<div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>代驾收费：</label>
		                    <div class="col-sm-7">
		                    <select class="form-control" id="areaId" name="areaId" required>
		                    	<option value="">--请选择--</option>
		                    	<#list arealist as area>
		                    		<option value="${area.id}" <#if company.areaId?? && (company.areaId==area.id)>selected="selected"</#if>>${area.name?if_exists}</option>
		                    	</#list>
		                    </select>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">代驾补单提成：</label>
		                    <div class="col-sm-7">
		                    <select class="form-control" id="bdLevelId" name="bdLevelId">
		                    	<option value="">使用默认提成</option>
		                    	<#list levellist as level>
		                    		<option value="${level.id}" <#if company.bdLevelId?? && (company.bdLevelId==level.id)>selected="selected"</#if>>${level.name?if_exists}</option>
		                    	</#list>
		                    </select>
		                    </div>
		                </div>
		                </@daijia>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>公司地址：</label>
		                    <div class="col-sm-7">
			                    <div class="input-group">
				                    <input class="form-control" id="companyAddress" name="companyAddress" type="text" value="${company.companyAddress?if_exists}" required/>
				                    <span class="input-group-btn">
				                            <button class="btn btn-default" type="button" id="btn-position">定位</button>
				                    </span>
			                    </div>
			                </div>
		                </div>
		                
						<div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>经度：</label>
		                    <div class="col-sm-4">
		                    	<span id="longitude_span">
		                    		${company.longitude?if_exists}
				            	</span>
		                    	<input type="hidden" name="longitude" id="longitude" value="${company.longitude?if_exists}">
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>纬度：</label>
		                    <div class="col-sm-4">
		                    	<span id="latitude_span">
		                    		${company.latitude?if_exists}
				            	</span>
				            	<input type="hidden" name="latitude" id="latitude" value="${company.latitude?if_exists}">
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>公司名称：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="companyName" name="companyName" type="text" value="${company.companyName?if_exists}" required/>
		                    </div>
		                </div>

                        <div class="form-group">
                            <label class="col-sm-4 control-label"><em>*</em>公司简称：</label>
                            <div class="col-sm-7">
                                <input class="form-control" id="abbreviation" name="abbreviation" type="text"  value="${company.abbreviation?if_exists}" required/>
                            </div>
                        </div>

		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>公司电话：</label>
		                    <div class="col-sm-7">
		                    	<input class="form-control" id="telephone" name="telephone" type="text" value="${company.telephone?if_exists}" required/>
		                    	<span class="help-block">用于APP显示</span>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">紧急电话：</label>
		                    <div class="col-sm-7">
		                    	<input class="form-control" id="emergencyPhone" name="emergencyPhone" type="text" value="${company.emergencyPhone?if_exists}"/>
		                    	<span class="help-block">用于客户端APP紧急呼叫</span>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">公司网址：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="companyWebURL" name="companyWebURL" type="text" value="${company.companyWebURL?if_exists}" />
		                    <span class="help-block">用于APP显示</span>
		                    </div>
		                </div>
		                <div class="form-group">
		                    <label class="col-sm-4 control-label"><em>*</em>负责人：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="manager" name="manager" type="text" value="${company.manager?if_exists}" required/>
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">手机号码：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="mobilePhone" name="mobilePhone" type="text" value="${company.mobilePhone?if_exists}"/>
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">传真：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="fox" name="fox" type="text" value="${company.fox?if_exists}" />
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">电子邮件：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="fox" name="email" type="email" value="${company.email?if_exists}" />
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">规模（人）：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="scope" name="scope" type="number"  value="${company.scope?if_exists}" min="0"/>
		                    </div>
		                </div>
		                

		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">400电话：</label>
		                    <div class="col-sm-7">
		                    <input class="form-control" id="fzzPhone" name="fzzPhone" type="text"  value="${company.fzzPhone?if_exists}" />
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-4 control-label">备注：</label>
		                    <div class="col-sm-7">
		                    <textarea class="form-control" cols="20" id="memo" name="memo" rows="2">${company.memo?if_exists}</textarea>
		                    </div>
		                </div>
		                
		                
		                <#if username?? && username=="admin">
			                <div class="form-group">
			                    <label class="col-sm-4 control-label">appKey：</label>
			                    <div class="col-sm-7">
			                    <input class="form-control" id="appKey" name="appKey" type="text" value="${company.appKey?if_exists}"/>
			                    </div>
			                </div>
			            <#else>
			            	<input type="hidden" id="appKey" name="appKey" value="${company.appKey?if_exists}">
		                </#if>
		                
		                <div class="form-group">
		                	<label class="col-sm-4 control-label">Logo：</label>
		                    <div class="col-sm-4">
		                    	<img id="logo_img" style="width: 128px; height: 128px; background:#eee;" src="${ctx}/${company.logo?if_exists}">
						    	<input style="display:none;" type="file" name="imgFile" id="imgFile" accept=".bmp,.gif,.jpeg,.jpg,.png">
						    	<input type="hidden" name="logo" id="logo" value="${company.logo?if_exists}">
		                    </div>
		                    <div class="col-sm-4">
		                    <span>双击区域上传 <br/> 大小128 × 128</span>
		                    </div>
						</div>
		                
    					
		                <div class="form-group" style="margin-left:10px;">
			                <label class="col-sm-3 control-label"></label>
			                <input type="submit" class="btn btn-primary" value="保存">
			                <input type="button" class="btn btn-default" onclick="window.location.href = '${ctx}/company/list';" value="返回">
			            </div>
					</form>
        		</div>
			</div>
		</div>
	</div>

</@override>
<@override name="footer">
	<script type="text/javascript">
		<#if message??>
			$.scojs_message("${message}", $.scojs_message.TYPE_ERROR);
		</#if>
	</script>
	<script src="//api.map.baidu.com/api?v=2.0&ak=AuNk3YS21DSmHEEvIFDf9dbD" type="text/javascript"></script> 
	<script src="${ctx}/assets/js/ajaxfileupload.js"></script>
	<script src="${ctx}/assets/js/jquery.cityselect.js"></script>
	<script src="${ctx}/assets/js/company.js"></script>
</@override>
<@extends name="../layout.ftl"/>